home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 038a / bas_int1.zip / ISFILE.BAS < prev    next >
BASIC Source File  |  1991-06-02  |  899b  |  23 lines

  1. '=================================================================
  2. 'Message #4706 - Quick Basic Forum
  3. '   Date : 29-May-91
  4. '   From : Kevin Gmyrek
  5. 'Subject : File handling (Open error)
  6. '
  7. 'FileExist - Converted from the Filexist subroutine posted in the
  8. '             QuickBASIC echo by Bob Perkins.  This functions returns
  9. '             TRUE if the named file exists or FALSE otherwise.  TRUE and
  10. '             FALSE should be global constants. Make sure you have
  11. '             included QB.BI as well as loaded the interrupt lib with QB
  12. '             /L from the DOS prompt.
  13. '========================================================================
  14. FUNCTION FileExist
  15.    testname$ = filename$ + CHR$(0)
  16.    InRegs.AX = &H4E00
  17.    InRegs.cx = &H0
  18.    InRegs.dx = SADD(testname$)
  19.    CALL INTERRUPT(&H21, InRegs, OutRegs)
  20.    FileExist = (OutRegs.flags AND &H1) XOR &H1
  21. END FUNCTION
  22.  
  23.